

import { observable, action } from "mobx";
import { ajax } from "../../api";

class Opinion {
    // 意见
    @observable opinionlist = []
    @action changeOpinionlist = (payload: any) => {
        this.opinionlist = payload
    }
    @action asyncGetOpinionlist = async (payload: any) => {
        let { code, result }: any = await ajax.opinionlist(payload)
        if(code == 200){
            this.opinionlist = result
        }
    }

    // 回评
    @observable backopinionlist = []
    @action changeBackopinionlist = (payload: any) => {
        this.backopinionlist = payload
    }
    @action asyncGetbackopinionlist = async (payload: any) => {
        let { code, result }: any = await ajax.backopinionlist(payload)
        if(code == 200){
            this.backopinionlist = result
        }
    }
}

export default new Opinion()